package com.cssy.xxkj.logic.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicWarehouseOtheroutItemDAO;
import com.cssy.xxkj.logic.entity.LogicWarehouseOtheroutDO;
import com.cssy.xxkj.logic.entity.LogicWarehouseOtheroutItemDO;
import com.plat.helper.SearchConditions;

/**
 * 数据访问对象实现类
 * @since 2014-09-17
 */
public class LogicWarehouseOtheroutItemDAOImpl extends SqlMapClientDaoSupport implements LogicWarehouseOtheroutItemDAO {

    /**
     * 插入数据
     * @param logicWarehouseOtheroutItemDO
     * @return 插入数据的主键
     */
    public String insertLogicWarehouseOtheroutItemDO(LogicWarehouseOtheroutItemDO logicWarehouseOtheroutItemDO) {
        Object id = getSqlMapClientTemplate().insert("LogicWarehouseOtheroutItem.insert", logicWarehouseOtheroutItemDO);
        return (String) id;
    }

    /**
     * 统计记录数
     * @param logicWarehouseOtheroutItemDO
     * @return 查出的记录数
     */
    public Integer countLogicWarehouseOtheroutItemDOByExample(LogicWarehouseOtheroutItemDO logicWarehouseOtheroutItemDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtheroutItem.countByDOExample", logicWarehouseOtheroutItemDO);
        return count;
    }

    /**
     * 更新记录
     * @param logicWarehouseOtheroutItemDO
     * @return 受影响的行数
     */
    public Integer updateLogicWarehouseOtheroutItemDO(LogicWarehouseOtheroutItemDO logicWarehouseOtheroutItemDO) {
        int result = getSqlMapClientTemplate().update("LogicWarehouseOtheroutItem.update", logicWarehouseOtheroutItemDO);
        return result;
    }

    /**
     * 获取对象列表
     * @param logicWarehouseOtheroutItemDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<LogicWarehouseOtheroutItemDO> findListByExample(LogicWarehouseOtheroutItemDO logicWarehouseOtheroutItemDO) {
        List<LogicWarehouseOtheroutItemDO> list = getSqlMapClientTemplate().queryForList("LogicWarehouseOtheroutItem.findListByDO", logicWarehouseOtheroutItemDO);
        return list;
    }
    
    public List<LogicWarehouseOtheroutItemDO> findListByMap(Map<String, Object> paramMap){
    	List<LogicWarehouseOtheroutItemDO> list = getSqlMapClientTemplate().queryForList("LogicWarehouseOtheroutItem_ex.findListByMap", paramMap);
        return list;
    }
    
    /**
     * 根据主键获取logicWarehouseOtheroutItemDO
     * @param id
     * @return logicWarehouseOtheroutItemDO
     */
    public LogicWarehouseOtheroutItemDO findLogicWarehouseOtheroutItemDOByPrimaryKey(String id) {
        LogicWarehouseOtheroutItemDO logicWarehouseOtheroutItemDO = (LogicWarehouseOtheroutItemDO) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtheroutItem.findByPrimaryKey", id);
        return logicWarehouseOtheroutItemDO;
    }

    /**
     * 删除记录
     * @param id
     * @return 受影响的行数
     */
    public Integer deleteLogicWarehouseOtheroutItemDOByPrimaryKey(String id) {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicWarehouseOtheroutItem.deleteByPrimaryKey", id);
        return rows;
    }

	@Override
	public List<LogicWarehouseOtheroutItemDO> findByPid(String pid) {
		List<LogicWarehouseOtheroutItemDO> list = getSqlMapClientTemplate().queryForList("LogicWarehouseOtheroutItem_ex.findByPid", pid);
        return list;
	}

	@Override
	public Integer deleteByPid(String id) {
		Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicWarehouseOtheroutItem_ex.deleteByPid", id);
        return rows;
	}

	@Override
	public List<LogicWarehouseOtheroutDO> find(SearchConditions scs)
			throws DataAccessException {
		List<LogicWarehouseOtheroutDO> list = getSqlMapClientTemplate().queryForList("LogicWarehouseOtheroutItem_ex.find", scs);
        return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtheroutItem_ex.count", scs);
        return count;
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		
		return null;
	}

}